import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView,

    redirect:'/welcome',
    children:[
      {path: '/welcome', component: () => import('../views/WelcomeView.vue')},
      {path: '/food', component: () => import('../views/food/FoodView.vue')},
      {path: '/customer', component: () => import('@/views/customer/CustomerView.vue')},
      {path: '/management', component: () => import('../views/management/MgmtView.vue')},
      {path: '/order', component: () => import('../views/order/OrderView.vue')},
      {path: '/restaurant', component: () => import('../views/restaurant/RstView.vue')}
    ]
  },
  {path: '/login', component: () => import('../views/LoginView')}
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
